package com.zyy.visitor.demo02;

/**
 * @Description: 类描述
 * @Author: zyy
 * @Date: 2023/08/09 23:07
 */
public class Execute {
    public void execute(Animal a) {
        System.out.println("Amimal");
    }

    public void execute(Cat c) {
        System.out.println("我是猫。。。");
    }

    public void execute(Dog d) {
        System.out.println("我是狗。。。");
    }
}

class Client {
    public static void main(String[] args) {
        Animal a = new Animal();
        Dog d = new Dog();
        Cat c = new Cat();

        Execute execute = new Execute();
        execute.execute(a);
        execute.execute(d);
        execute.execute(c);
    }
}
